package com.hellohoper.script.config.admin.app.controller;

import com.hellohoper.script.config.admin.app.dao.pojo.ScriptConfig;
import com.hellohoper.script.config.api.feign.ScriptConfigFeign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 首页
 * Created by hk on 12/8/16.
 */
@Controller
public class IndexController {

    private static final Logger LOGGER = LoggerFactory.getLogger(IndexController.class);

    @Autowired
    private ScriptConfigFeign scriptConfigFeign;

    @RequestMapping("/")
    public String index(HttpServletRequest request) {
        LOGGER.info("index start............");
        List<ScriptConfig> scriptConfigs = scriptConfigFeign.searchConfig("script-config-admin-app");
        LOGGER.info("index start............" + scriptConfigs.size());
        return "/index.html";
    }
}
